package code.rocky.chapter05;

import java.util.ArrayList;
import java.util.List;

public class Suggest72 {
    public static void main(String[] args) {
        List<String> list = new ArrayList<>();
        list.add("A");
        list.add("B");
        list.add("C");

        List<String> subList = list.subList(0, 2);
        list.add("D");
        System.out.println("原列表长度: " + list.size());
        System.out.println("子列表长度: " + subList.size());
    }
}
